import React,{Component} from 'react';
import fetch from 'isomorphic-fetch';
import './../../css/reset.css';
import './../../css/main.css';
import './css/food.css';
import $ from 'jquery';
import Blank from './../../components/blank/blank';
import Grid from './../../components/grid/grid.jsx';
const content=[
{name:'火锅',url:'./hot-pot'},
{name:'甜点饮品',url:'./film'},
{name:'自助餐',url:'./hotel'},
{name:'小吃快餐',url:'./entertainment'},
{name:'西餐',url:'./take-out-food'},
{name:'烧烤烤肉',url:'./ktv'},
{name:'香锅烤鱼',url:'./sightseeing'},
{name:'海鲜',url:'./beauty'}]
class Clumn extends Component{
  constructor(props){
    super(props);
    this.state={};
  }
  getUrlParam(name){
    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    let hrefSeach='';
    if(window.location.href.indexOf('?')>0){
      hrefSeach = window.location.href.split('?')[1];
    }else{
      return;
    }
    let rl = hrefSeach.match(reg);
    if (rl != null) return decodeURI(rl[2]); return null;
  }
  componentDidMount(){
    fetch('this.props.url')
      .then(response=>response.json())
      .then(json=>{
        this.setState(json);
      })
      .catch((error) => {  
        console.error(error);  
      });  
  }
  render(){
  	return(
  		<div className='food_view'>
        <Grid data={content} num={4} />
  		</div>
  		)
  }
}
export default Clumn;